const express = require('express')
const router = express.Router()
// 导入用户路由处理函数模块
const userHandler = require('../router_handler/user')
// 导入云养路由处理函数模块
const adoptedHandler = require('../router_handler/adopted')
// 导入投喂路由处理函数模块
const feededHandler = require('../router_handler/feeded')
// 导入文件路由处理函数模块
const fileHandler = require('../router_handler/file')
// 导入科普路由处理函数模块
const scienceHandler = require('../router_handler/science')

const { route } = require('express/lib/application')


// 登录
router.post('/login', userHandler.login)

// 注册
router.post('/register', userHandler.register)

// 展示云养中心
router.get('/showAdoptedDog', adoptedHandler.showAdoptedDog)
// 通过ID查询云养狗狗信息
router.post('/queryAdoptedDogById', adoptedHandler.queryAdoptedDogById)
// 通过Name查询云养狗狗信息
router.post('/queryAdoptedDogByName', adoptedHandler.queryAdoptedDogByName)
// 通过userID查询我的云养
router.post('/queryAdoptedByUserId', adoptedHandler.queryAdoptedByUserId)
// 绑定云养人和云养宠物
router.post('/bindAdoptedDogWithUser', adoptedHandler.bindAdoptedDogWithUser)
// 发布云养宠物信息
router.post('/addAdoptedDogInfo', adoptedHandler.addAdoptedDogInfo)
// 查看所有云养信息
router.get('/showAllAdoptedInfo', adoptedHandler.showAllAdoptedInfo)
// 解除云养关联
router.post('/deleteAdoptedInfo', adoptedHandler.deleteAdoptedInfo)
// 添加云养支付记录
router.post('/addAdoptedPaymentInfo', adoptedHandler.addAdoptedPaymentInfo)
// 通过领养宠物id获取图片路径
router.post('/showAdoptedDogImg', adoptedHandler.showAdoptedDogImg)




// 展示投喂广场
router.get('/showFeededDog', feededHandler.showFeededDog)
// 通过ID查询投喂狗狗信息
router.post('/queryFeededDogById', feededHandler.queryFeededDogById)
// 通过name查询投喂狗狗信息
router.post('/queryFeededDogByName', feededHandler.queryFeededDogByName)
// 保存投喂信息
router.post('/addFeededAmount', feededHandler.addFeededAmount)
// 发布投喂宠物信息
router.post('/addFeededDogInfo', feededHandler.addFeededDogInfo)
// 通过投喂宠物id获取图片
router.post('/showFeededDogImg', feededHandler.showFeededDogImg)


// 上传图片
router.post('/uploadImg', fileHandler.uploadImg);

// 通过type查询科普内容
router.post('/queryScienceByType', scienceHandler.queryScienceByType);
// 通过id查询科普内容
router.post('/queryScienceById', scienceHandler.queryScienceById);

// 通过userID查询我的云养记录
router.post('/queryMyAdoptedListByUserId', adoptedHandler.queryMyAdoptedListByUserId)
// 通过userID查询我的投喂记录
router.post('/queryMyFeededListByUserId', feededHandler.queryMyFeededListByUserId)

// 通过ID修改投喂狗狗信息
router.post('/updateFeededDogById', feededHandler.updateFeededDogById)

// 通过ID删除投喂狗狗信息
router.post('/deleteFeededDogById', feededHandler.deleteFeededDogById)

// 通过ID修改云养狗狗信息
router.post('/updateAdoptedDogById', adoptedHandler.updateAdoptedDogById)

// 通过ID删除云养狗狗信息
router.post('/deleteAdoptedDogById', adoptedHandler.deleteAdoptedDogById)

module.exports = router